package com.xiaoshuidi.cloud.module.report.constant;

public enum SexEnum {

    MALE(1,"男"),
    FEMALE(2,"女"),
    OTHER(0,"未知"),
    ;

    private Integer code;
    private String value;

    SexEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    public static String getValueByCode(Integer code){
        for (SexEnum sexEnum : SexEnum.values()) {
            if(sexEnum.getCode().equals(code)){
                return sexEnum.getValue();
            }
        }
        //
        return OTHER.getValue();
    }
}
